<#include "/@inc/funcMacros.ftl">
<#include "/@inc/copyright.txt">
<#assign className = TriaGram + "E" + Prefix + LateType + "AttrBehavior">
<#assign intfName = TriaGram + "I" + Prefix + LateType>
<@pp.renameOutputFile name=className+".cpp">
</@pp.renameOutputFile>

//======================================================================================
//
// ${className}.cpp
// Provide implementation to interface
//      CATIAttrBehavior
//======================================================================================

// Local Framework
#include "${className}.h"

// System Framework
#include "CATUnicodeString.h"       // To handle Unicode String

<#list Attributes as attrib>  <#t>
<#switch attrib.type>
<#case "tk_component"><#t>
<#case "tk_specobject"><#t>
<#case "tk_external"><#t>
<#case "tklist_component">
<#case "tklist_spec">
#include  "attrib.IID"
<#break>
</#switch>
</#list>


CATImplementClass ( ${className} ,
                   CodeExtension ,
                   CATBaseUnknown ,
                   ${TriaGram}${Prefix}${LateType} );


#include "TIE_CATIAttrBehavior.h" // needed to tie the implementation to its interface
TIE_CATIAttrBehavior( ${className});

//========================================================================
// Constructor - Destructor
//========================================================================
${className}::${className}():CATBaseUnknown()
{
}

${className}::~${className}()
{
}

//------------------------------------------------------------------------
//   GetRequestedBehavior
//------------------------------------------------------------------------
HRESULT ${className}::GetRequestedBehavior(const CATUnicodeString* ipAttrId, CATBehaviorSpecs** oppBehavior)
{

   HRESULT rc =E_FAIL;
   if ( (NULL == oppBehavior) || ( NULL == ipAttrId) )
   {
		return rc ;
   }
  *oppBehavior = new CATBehaviorSpecs;

<#list Attributes as attrib>  <#t>
<#switch attrib.type>
<#case "tk_component"><#t>
<#case "tk_specobject"><#t>
<#case "tk_external"><#t>
<#case "tklist_component">
<#case "tklist_spec">
	 if (2 == ipAttrId->Compare("attrib.name") )
	 {
		CATListPV* aMyFirstList = new CATListPV;
		aMyFirstList->Append((void*)&$attrib.IID);
		(*oppBehavior)->Append(aMyFirstList);
		rc = S_OK ;
	 }
<#break>
</#switch>
</#list>

   return rc ;
}
